<?php

class Item extends AdminController {

    public function __construct() {
        parent::__construct();
    }
    
    public function index() 
    {
        $this->view->list = $this->model->get();   
        $this->view->render('item/index');
    }
    
    public function view( $id)
    {
        $this->view->render('item/view');
    }
    
    public function add()
    {
        $this->view->categories = $this->model->getAllCategories();
        $this->view->render('item/add');
    }
    
   public function ajaxCategoryFields($name)
   {
       echo $this->model->getSchema( $name);
   }
}